<?php
/**
 * @user:andy
 * @date:2021/7/3
 * @company:http://www.sjdphp.com
 * @desc: 角色类
 */

namespace app\admin\controller;


use app\common\controller\BackBaseController;
use app\common\model\Menu as MenuModel;
use app\common\server\Json;
use app\common\server\Tree;

class Role extends BackBaseController
{
    protected $model_id = 'role_id';
    protected $model_name = 'role_name';
    protected $model_status = 'role_status';

    public function getMenuLists(){
        if($this->request->isGet()){
            $lists = MenuModel::where('menu_status','<>',config("project.mysql_code.table_delete"))->field("menu_id as id,menu_name as title,pid")->select()->order("menu_sort desc")->toArray();
            return Json::success('获取成功',Tree::getLayerTree($lists));
        }
    }
}